#include<bits/stdc++.h>
#define int long long
#define fff(i,l,r) for(int i=l;i<=r;i++)
using namespace std;
const int N=1e5+5; 
int n,a[N];
map<int,int> mp;
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    fff(i,1,n){
        cin>>a[i];
        mp[a[i]]++;
    }
    sort(a+1,a+n+1);
    int ans=n;
    int lassum=0,lasi=0;
    for(int i=1;i<=n;i+=mp[a[i]]){
        // cout<<a[i]<<':'<<mp[a[i]]<<'\n';
        ans-=min(mp[a[i]],lassum);
        if(mp[a[i]]<=lassum)lassum-=mp[a[i]];
        else lassum=0;
        lassum+=mp[a[i]];
        lasi=i;
    }
    cout<<ans;
    return 0;
}
/*
10
136 136 136 2417 136 136 2417 136 136 136
*/